import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';

export default async function a002(fd: IFeidaoAiBrowserComponent) {
	// todo
	// 点击我接受的 触发
	const chkAll = fd.data.node.querySelector<HTMLInputElement>('[data-id="chk-all"]');
	const chk = chkAll.checked;
	// console.log(chk);
	const chkList = fd.data.node.querySelectorAll<HTMLInputElement>('[data-id="chk-list"]');
	const lists = Array.from(chkList) as HTMLInputElement[];
	lists.forEach((value) => {
		value.checked = chk;
	});
	const chkAll1 = fd.data.node.querySelector<HTMLInputElement>('[data-id="chk-all1"]');
	const chk1 = chkAll1.checked;
	// console.log(chk1);
	const chkList1 = fd.data.node.querySelectorAll<HTMLInputElement>('[data-id="chk-list1"]');
	const lists1 = Array.from(chkList1) as HTMLInputElement[];
	lists1.forEach((value) => {
		value.checked = chk1;
	});
}
